<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>通用管理平台</title>
	<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
	<script src="../static/svs/js/common.js" th:src="@{/svs/js/common.js?v=3.0.0}"></script>
	<script src="../static/js/jsencrypt.min.js" th:src="@{/js/jsencrypt.min.js}"></script>
	<script src="../static/js/aes.js" th:src="@{/js/aes.js}"></script>
	<link th:href="@{/util/iconfont.css}" rel="stylesheet"/>
	<style>
		html {
			height: 100%;
		}
		body {
			position: relative;
			margin: 0;
			font-family: "Microsoft YaHei";
			height: 100%;
			overflow: hidden;
		}
		.all{
			height: 100%;
			overflow: hidden;
		}
		.con {
			position: relative;
			width: 100%;
			height: 100%;
			background: #fff;
		}
		.login{
			position: relative;
		}
		.login_img{
			height:4.59rem;
		}
		.login_img img{
			height: 100%;
		}
		.box{
			padding-top: .58rem;
		}
		.dl_tit{
			margin-bottom: .8rem;
			font-size: .4rem;
			font-weight: bold;
			color: #010101;
			text-align: center;
		}
		.login_box{
			padding: 0 .6rem;
			margin-bottom: .83rem;
		}
		.dl_item{
			margin-bottom: .42rem;
			padding-left: .4rem;
			padding-right: .25rem;
			display: flex;
			align-items: center;
			width: 100%;
			height: 1rem;
			border:1px solid #808080;
			border-radius: 1rem;
			box-sizing: border-box;
		}
		.dl_item i{
			font-size: .4rem;
			color: #808080;
		}
		.dl_item input{
			float: left;
			padding: 0 .32rem;
			width: 100%;
			height: .9rem;
			line-height: .9rem;
			font-size: .24rem;
			color: #666;
			border:0;
			box-sizing: border-box;
		}
		input:disabled{
			background: none;
		}
		.dl_item_btn{
			margin: .52rem 0;
			height:1rem;
			background:#2c57ad;
			border-radius:1rem;
		}
		.dl_item_btn button{
			width: 100%;
			height:1rem;
			line-height: 1rem;
			font-size: .34rem;
			color: #fff;
			background: none;
			border:0;
			border-radius: .1rem;
			cursor: pointer;
		}
		.tip{
			position: absolute;
			bottom: .26rem;
			width: 100%;
			font-size: .28rem;
			color: #808080;
			text-align: center;
		}
	</style>
</head>
<body>
<div class="all">
	<div class="con login">
		<div class="login_img"><img src="/img/admin_bg.png"/> </div>
		<div class="box">
			<div class="dl_tit">通用管理平台</div>
			<div class="login_box" >
				<div class="dl_item">
					<i class="iconfont icon-gerenzhongxin"></i>
					<input type="hidden" name="signType" id="signType" th:value="${signType}"/>
					<input type="text" placeholder="请输入用户名" id="username" name="username" required  />
				</div>
				<div class="dl_item">
					<i class="iconfont icon-mimacopy"></i>
					<input type="password" placeholder="请输入密码" id="password" name="password" required  />
					<input type="hidden" name="validateCode" id="validateCode" />
				</div>
				<div class="dl_item dl_item_btn"><button id="btnSubmit1">登录</button></div>
			</div>
		</div>
		<div class="tip"></div>
	</div>
</div>
<script type="text/javascript">
	if(window !=top){
		top.location.href = location.href;
	}
	var head = document.getElementsByTagName('head')[0];

	var meta = document.createElement('meta');

	meta.name = "viewport";

	var i = window.devicePixelRatio>1?1/ window.devicePixelRatio:1;

	meta.content = "width=device-width,user-scalable=no,initial-scale="+i+",maximum-scale="+i+",minimum-scale="+i;

	head.appendChild(meta);

	var html = document.getElementsByTagName('html')[0];

	var iW = window.innerWidth;

	var font = iW/7.5;

	html.style.fontSize = font+'px';

	console.log(iW,font)
	var ctx = '/';
	$("body").on("click","#btnSubmit1",function(){
		var username = $("#username").val();
		var password = $("#password").val();
		var validateCode = null;
		var rememberMe = true ;
		//获取系统加密方式
		var str  ="username="+username+"&password="+password;
		username = encryptStr(username);
		password = encryptStr(password);
		str = encryptStr(str);
		$.ajax({
			type : "post",
			url : ctx + "login",
			data : {
				"username" : username,
				"password" : password,
				"validateCode" : validateCode,
				"rememberMe" : rememberMe
			},
			success : function(r) {
				if (r.code == 0) {
					location.href = ctx + 'index';
				} else {
					alert(r.msg);
					$('.imgcode').click();
					$(".code").val("");
				}
			}
		});
	}) ;

</script>
</body>
</html>